Log-Linear DRiT - MA Data Analysis
Scatter plot
Food waste plots
Log-Linear RDiT Model
No Interaction
##
## Call:
## lm(formula = rdt_fw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.69473 -0.20951 -0.01034 0.20536 0.89779
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.128e-01 2.971e-01 -0.380 0.70468
## container 1.353e-01 1.516e-01 0.892 0.37383
## time -3.656e-04 2.901e-03 -0.126 0.89991
## temp_c 6.389e-04 4.123e-03 0.155 0.87706
## humi_p 1.354e-03 2.908e-03 0.466 0.64223
## prcp_mm -1.966e-02 1.303e-02 -1.508 0.13363
## liquors 9.676e-03 1.714e-02 0.565 0.57324
## sales 1.219e-03 1.864e-04 6.539 9.9e-10 ***
## halfs 3.033e-02 9.467e-03 3.204 0.00167 **
## tueE 8.082e-02 6.090e-02 1.327 0.18653
## wedE -5.358e-02 6.031e-02 -0.888 0.37584
## thuE -9.359e-02 5.840e-02 -1.603 0.11121
## friE 2.546e-02 5.733e-02 0.444 0.65767
## satE -8.157e-02 6.012e-02 -1.357 0.17699
## I(t_01^2) -1.765e-06 2.092e-05 -0.084 0.93287
## I(t_01^3) 5.997e-09 4.378e-07 0.014 0.98909
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3212 on 145 degrees of freedom
## Multiple R-squared: 0.5597, Adjusted R-squared: 0.5141
## F-statistic: 12.29 on 15 and 145 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = rdt_sfw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.41972 -0.15281 -0.02966 0.12139 0.86129
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -5.859e-02 1.948e-01 -0.301 0.7641
## container 7.329e-02 9.945e-02 0.737 0.4623
## time -1.663e-03 1.903e-03 -0.874 0.3836
## temp_c -4.069e-04 2.704e-03 -0.150 0.8806
## humi_p -2.542e-04 1.907e-03 -0.133 0.8942
## prcp_mm -1.100e-02 8.545e-03 -1.287 0.2001
## liquors 6.818e-03 1.124e-02 0.607 0.5450
## sales 7.214e-04 1.222e-04 5.902 2.43e-08 ***
## halfs 8.369e-03 6.208e-03 1.348 0.1798
## tueE 8.216e-02 3.994e-02 2.057 0.0415 *
## wedE -1.017e-02 3.955e-02 -0.257 0.7974
## thuE -7.300e-02 3.830e-02 -1.906 0.0586 .
## friE 1.835e-02 3.760e-02 0.488 0.6263
## satE -5.163e-02 3.943e-02 -1.309 0.1925
## I(t_01^2) -6.945e-06 1.372e-05 -0.506 0.6134
## I(t_01^3) 1.954e-07 2.871e-07 0.681 0.4972
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2107 on 145 degrees of freedom
## Multiple R-squared: 0.4411, Adjusted R-squared: 0.3833
## F-statistic: 7.629 on 15 and 145 DF, p-value: 2.423e-12
##
## Call:
## lm(formula = rdt_lfw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.64100 -0.20498 -0.00026 0.20036 0.72545
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.290e-01 2.658e-01 -0.862 0.390362
## container 1.194e-01 1.357e-01 0.880 0.380111
## time 1.004e-03 2.596e-03 0.387 0.699434
## temp_c 6.327e-04 3.689e-03 0.172 0.864054
## humi_p 1.707e-03 2.602e-03 0.656 0.512829
## prcp_mm -1.539e-02 1.166e-02 -1.320 0.188977
## liquors 5.995e-03 1.533e-02 0.391 0.696359
## sales 1.012e-03 1.667e-04 6.072 1.06e-08 ***
## halfs 3.069e-02 8.470e-03 3.624 0.000401 ***
## tueE 2.502e-02 5.448e-02 0.459 0.646725
## wedE -5.596e-02 5.396e-02 -1.037 0.301454
## thuE -7.529e-02 5.225e-02 -1.441 0.151729
## friE 3.404e-02 5.129e-02 0.664 0.508008
## satE -5.831e-02 5.379e-02 -1.084 0.280162
## I(t_01^2) 2.475e-06 1.871e-05 0.132 0.894981
## I(t_01^3) -2.249e-07 3.916e-07 -0.574 0.566698
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2874 on 145 degrees of freedom
## Multiple R-squared: 0.5625, Adjusted R-squared: 0.5172
## F-statistic: 12.43 on 15 and 145 DF, p-value: < 2.2e-16
Interaction
##
## Call:
## lm(formula = rdt_int_fw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.07089 -0.29053 0.07099 0.31294 0.92461
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.899186 0.100117 8.981 7.9e-16 ***
## container 0.125174 0.145241 0.862 0.3901
## time -0.003624 0.001999 -1.813 0.0717 .
## container:time 0.004636 0.003166 1.464 0.1451
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4602 on 157 degrees of freedom
## Multiple R-squared: 0.02157, Adjusted R-squared: 0.002876
## F-statistic: 1.154 on 3 and 157 DF, p-value: 0.3293
##
## Call:
## lm(formula = rdt_int_sfw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.49626 -0.17125 -0.02458 0.17911 0.84798
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.456958 0.058104 7.864 5.59e-13 ***
## container -0.002367 0.084292 -0.028 0.978
## time -0.001638 0.001160 -1.412 0.160
## container:time 0.001864 0.001837 1.015 0.312
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2671 on 157 degrees of freedom
## Multiple R-squared: 0.0273, Adjusted R-squared: 0.008717
## F-statistic: 1.469 on 3 and 157 DF, p-value: 0.2251
##
## Call:
## lm(formula = rdt_int_lfw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.86306 -0.32547 0.08476 0.29523 0.83820
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.647578 0.089499 7.236 1.93e-11 ***
## container 0.172827 0.129837 1.331 0.1851
## time -0.003520 0.001787 -1.970 0.0506 .
## container:time 0.004447 0.002830 1.572 0.1181
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4114 on 157 degrees of freedom
## Multiple R-squared: 0.02936, Adjusted R-squared: 0.01082
## F-statistic: 1.583 on 3 and 157 DF, p-value: 0.1956
Ass-Interaction
- Linearity of the relationships between the dependent and independent variables
- Normality of the residuals
- Homoscedasticity of the residuals
- No influential points (outliers)
- No multicollinearity
- Independence of the observations
## OK: Error variance appears to be homoscedastic (p = 0.654).
## OK: Error variance appears to be homoscedastic (p = 0.064).
## OK: Error variance appears to be homoscedastic (p = 0.778).
## Warning: Non-normality of residuals detected (p = 0.014).
## Warning: Non-normality of residuals detected (p = 0.044).
## Warning: Non-normality of residuals detected (p = 0.004).
##
## studentized Breusch-Pagan test
##
## data: rdt_int_fw_log
## BP = 1.4669, df = 3, p-value = 0.6899
##
## studentized Breusch-Pagan test
##
## data: rdt_int_sfw_log
## BP = 3.892, df = 3, p-value = 0.2734
##
## studentized Breusch-Pagan test
##
## data: rdt_int_lfw_log
## BP = 2.2738, df = 3, p-value = 0.5176
## OK: No outliers detected.
## - Based on the following method and threshold: cook (0.8).
## - For variable: (Whole model)
## OK: No outliers detected.
## - Based on the following method and threshold: cook (0.8).
## - For variable: (Whole model)
## OK: No outliers detected.
## - Based on the following method and threshold: cook (0.8).
## - For variable: (Whole model)
## OK: Residuals appear to be independent and not autocorrelated (p = 0.702).
## OK: Residuals appear to be independent and not autocorrelated (p = 0.702).
## OK: Residuals appear to be independent and not autocorrelated (p = 0.550).
Multiple model
##
## Call:
## lm(formula = rdt_multi_fw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.70381 -0.21143 -0.01368 0.21472 0.89566
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.2025206 0.3094972 -0.654 0.51391
## container 0.1371993 0.1171206 1.171 0.24333
## time -0.0009055 0.0021069 -0.430 0.66799
## temp_c -0.0003912 0.0040574 -0.096 0.92332
## humi_p 0.0021214 0.0029957 0.708 0.47999
## prcp_mm -0.0197288 0.0129534 -1.523 0.12991
## tueE 0.0791179 0.0604806 1.308 0.19288
## wedE -0.0539749 0.0600338 -0.899 0.37009
## thuE -0.0914458 0.0582575 -1.570 0.11865
## friE 0.0253774 0.0570715 0.445 0.65722
## satE -0.0820893 0.0599080 -1.370 0.17271
## liquors 0.0099865 0.0170719 0.585 0.55947
## sales 0.0012110 0.0001851 6.544 9.5e-10 ***
## halfs 0.0311432 0.0093690 3.324 0.00112 **
## container:time 0.0011543 0.0032081 0.360 0.71952
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.32 on 146 degrees of freedom
## Multiple R-squared: 0.56, Adjusted R-squared: 0.5179
## F-statistic: 13.27 on 14 and 146 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = rdt_multi_sfw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.41365 -0.15187 -0.03471 0.12691 0.87801
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.0830067 0.2039018 -0.407 0.6845
## container 0.0312116 0.0771610 0.405 0.6864
## time -0.0002954 0.0013880 -0.213 0.8318
## temp_c -0.0011196 0.0026731 -0.419 0.6759
## humi_p 0.0002079 0.0019736 0.105 0.9163
## prcp_mm -0.0109674 0.0085339 -1.285 0.2008
## tueE 0.0817078 0.0398456 2.051 0.0421 *
## wedE -0.0098532 0.0395513 -0.249 0.8036
## thuE -0.0723120 0.0383810 -1.884 0.0615 .
## friE 0.0170265 0.0375997 0.453 0.6513
## satE -0.0516432 0.0394684 -1.308 0.1928
## liquors 0.0066501 0.0112472 0.591 0.5553
## sales 0.0007099 0.0001219 5.823 3.54e-08 ***
## halfs 0.0096277 0.0061724 1.560 0.1210
## container:time -0.0003659 0.0021136 -0.173 0.8628
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2108 on 146 degrees of freedom
## Multiple R-squared: 0.4364, Adjusted R-squared: 0.3823
## F-statistic: 8.074 on 14 and 146 DF, p-value: 1.421e-12
##
## Call:
## lm(formula = rdt_multi_lfw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.64161 -0.19503 0.00511 0.19954 0.72644
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.3398374 0.2771014 -1.226 0.222022
## container 0.1723560 0.1048614 1.644 0.102399
## time -0.0012647 0.0018863 -0.670 0.503613
## temp_c -0.0002052 0.0036327 -0.056 0.955037
## humi_p 0.0023787 0.0026821 0.887 0.376597
## prcp_mm -0.0154073 0.0115976 -1.328 0.186087
## tueE 0.0226180 0.0541500 0.418 0.676785
## wedE -0.0570734 0.0537500 -1.062 0.290065
## thuE -0.0728029 0.0521596 -1.396 0.164902
## friE 0.0353672 0.0510977 0.692 0.489944
## satE -0.0588896 0.0536373 -1.098 0.274045
## liquors 0.0066489 0.0152849 0.435 0.664208
## sales 0.0010125 0.0001657 6.111 8.56e-09 ***
## halfs 0.0305461 0.0083883 3.642 0.000376 ***
## container:time 0.0018389 0.0028723 0.640 0.523038
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2865 on 146 degrees of freedom
## Multiple R-squared: 0.5622, Adjusted R-squared: 0.5202
## F-statistic: 13.39 on 14 and 146 DF, p-value: < 2.2e-16
Ass-Multiple
- Linearity of the relationships between the dependent and independent variables
- Normality of the residuals
- Homoscedasticity of the residuals
- No influential points (outliers)
- No multicollinearity
- Independence of the observations
## Warning: Heteroscedasticity (non-constant error variance) detected (p = 0.019).
## OK: Error variance appears to be homoscedastic (p = 0.448).
## OK: Error variance appears to be homoscedastic (p = 0.205).
## OK: residuals appear as normally distributed (p = 0.831).
## Warning: Non-normality of residuals detected (p < .001).
## OK: residuals appear as normally distributed (p = 0.695).
##
## studentized Breusch-Pagan test
##
## data: rdt_multi_fw_log
## BP = 20.433, df = 14, p-value = 0.1171
##
## studentized Breusch-Pagan test
##
## data: rdt_multi_sfw_log
## BP = 12.468, df = 14, p-value = 0.5688
##
## studentized Breusch-Pagan test
##
## data: rdt_multi_lfw_log
## BP = 12.443, df = 14, p-value = 0.5708
## OK: Residuals appear to be independent and not autocorrelated (p = 0.698).
## OK: Residuals appear to be independent and not autocorrelated (p = 0.574).
## OK: Residuals appear to be independent and not autocorrelated (p = 0.652).
Quadratic model
##
## Call:
## lm(formula = rdt_poly_fw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.69414 -0.21485 -0.01643 0.20846 0.86740
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.143e-01 3.323e-01 -0.946 0.34584
## container 1.217e-01 1.661e-01 0.732 0.46514
## time -5.608e-03 5.959e-03 -0.941 0.34821
## I(time^2) -5.680e-05 6.445e-05 -0.881 0.37959
## tueE 8.403e-02 6.077e-02 1.383 0.16885
## wedE -5.148e-02 6.017e-02 -0.855 0.39370
## thuE -8.756e-02 5.843e-02 -1.498 0.13619
## friE 2.777e-02 5.720e-02 0.485 0.62812
## satE -8.818e-02 6.018e-02 -1.465 0.14505
## temp_c 1.016e-04 4.091e-03 0.025 0.98023
## humi_p 2.575e-03 3.028e-03 0.850 0.39655
## prcp_mm -2.309e-02 1.325e-02 -1.742 0.08362 .
## liquors 1.115e-02 1.712e-02 0.651 0.51593
## sales 1.236e-03 1.864e-04 6.633 6.2e-10 ***
## halfs 3.051e-02 9.438e-03 3.232 0.00152 **
## container:time 1.241e-02 9.400e-03 1.320 0.18895
## container:I(time^2) -3.033e-05 1.103e-04 -0.275 0.78368
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3204 on 144 degrees of freedom
## Multiple R-squared: 0.5649, Adjusted R-squared: 0.5166
## F-statistic: 11.69 on 16 and 144 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = rdt_poly_sfw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.37382 -0.14580 -0.02945 0.12595 0.83578
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.350e-01 2.169e-01 -1.084 0.2803
## container 7.135e-02 1.084e-01 0.658 0.5115
## time -7.037e-03 3.889e-03 -1.810 0.0724 .
## I(time^2) -7.958e-05 4.206e-05 -1.892 0.0605 .
## tueE 8.512e-02 3.966e-02 2.146 0.0335 *
## wedE -8.221e-03 3.927e-02 -0.209 0.8345
## thuE -6.772e-02 3.813e-02 -1.776 0.0778 .
## friE 2.029e-02 3.733e-02 0.544 0.5875
## satE -5.734e-02 3.927e-02 -1.460 0.1465
## temp_c -7.590e-04 2.670e-03 -0.284 0.7766
## humi_p 7.689e-04 1.976e-03 0.389 0.6978
## prcp_mm -1.403e-02 8.650e-03 -1.622 0.1071
## liquors 7.994e-03 1.117e-02 0.715 0.4755
## sales 7.370e-04 1.216e-04 6.060 1.13e-08 ***
## halfs 8.552e-03 6.159e-03 1.389 0.1671
## container:time 1.087e-02 6.134e-03 1.773 0.0784 .
## container:I(time^2) 2.076e-05 7.197e-05 0.288 0.7734
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2091 on 144 degrees of freedom
## Multiple R-squared: 0.4532, Adjusted R-squared: 0.3924
## F-statistic: 7.458 on 16 and 144 DF, p-value: 1.713e-12
##
## Call:
## lm(formula = rdt_poly_lfw_log, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.63819 -0.19662 0.00115 0.19553 0.73005
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.425e-01 2.983e-01 -1.148 0.252852
## container 9.485e-02 1.491e-01 0.636 0.525707
## time -9.383e-04 5.349e-03 -0.175 0.860998
## I(time^2) 1.604e-06 5.785e-05 0.028 0.977924
## tueE 2.685e-02 5.455e-02 0.492 0.623250
## wedE -5.479e-02 5.401e-02 -1.014 0.312064
## thuE -7.183e-02 5.245e-02 -1.370 0.172951
## friE 3.540e-02 5.135e-02 0.689 0.491645
## satE -6.229e-02 5.402e-02 -1.153 0.250828
## temp_c 1.960e-04 3.672e-03 0.053 0.957513
## humi_p 2.460e-03 2.718e-03 0.905 0.367005
## prcp_mm -1.739e-02 1.190e-02 -1.462 0.145983
## liquors 6.977e-03 1.537e-02 0.454 0.650533
## sales 1.022e-03 1.673e-04 6.110 8.85e-09 ***
## halfs 3.079e-02 8.471e-03 3.635 0.000386 ***
## container:time 7.218e-03 8.438e-03 0.855 0.393773
## container:I(time^2) -7.877e-05 9.900e-05 -0.796 0.427521
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2876 on 144 degrees of freedom
## Multiple R-squared: 0.5649, Adjusted R-squared: 0.5165
## F-statistic: 11.68 on 16 and 144 DF, p-value: < 2.2e-16
Ass-Poly
- Linearity of the relationships between the dependent and independent variables
- Normality of the residuals
- Homoscedasticity of the residuals
- No influential points (outliers)
- No multicollinearity
- Independence of the observations
## Warning: Heteroscedasticity (non-constant error variance) detected (p = 0.013).
## OK: Error variance appears to be homoscedastic (p = 0.434).
## OK: Error variance appears to be homoscedastic (p = 0.117).
## OK: residuals appear as normally distributed (p = 0.890).
## Warning: Non-normality of residuals detected (p < .001).
## OK: residuals appear as normally distributed (p = 0.613).
##
## studentized Breusch-Pagan test
##
## data: rdt_poly_fw_log
## BP = 24.13, df = 16, p-value = 0.08671
##
## studentized Breusch-Pagan test
##
## data: rdt_poly_sfw_log
## BP = 13.961, df = 16, p-value = 0.6016
##
## studentized Breusch-Pagan test
##
## data: rdt_poly_lfw_log
## BP = 17.492, df = 16, p-value = 0.3545
## OK: No outliers detected.
## - Based on the following method and threshold: cook (1).
## - For variable: (Whole model)
## OK: No outliers detected.
## - Based on the following method and threshold: cook (1).
## - For variable: (Whole model)
## OK: No outliers detected.
## - Based on the following method and threshold: cook (1).
## - For variable: (Whole model)
## Model has interaction terms. VIFs might be inflated.
## You may check multicollinearity among predictors of a model without
## interaction terms.
## # Check for Multicollinearity
##
## Low Correlation
##
## Term VIF VIF 95% CI Increased SE Tolerance Tolerance 95% CI
## tueE 1.87 [ 1.56, 2.33] 1.37 0.54 [0.43, 0.64]
## wedE 1.83 [ 1.54, 2.28] 1.35 0.55 [0.44, 0.65]
## thuE 1.66 [ 1.41, 2.07] 1.29 0.60 [0.48, 0.71]
## friE 1.65 [ 1.41, 2.06] 1.29 0.60 [0.49, 0.71]
## satE 1.80 [ 1.51, 2.24] 1.34 0.56 [0.45, 0.66]
## temp_c 2.34 [ 1.93, 2.95] 1.53 0.43 [0.34, 0.52]
## humi_p 2.01 [ 1.67, 2.52] 1.42 0.50 [0.40, 0.60]
## prcp_mm 1.25 [ 1.11, 1.57] 1.12 0.80 [0.64, 0.90]
## liquors 1.54 [ 1.32, 1.91] 1.24 0.65 [0.52, 0.76]
## sales 2.49 [ 2.04, 3.14] 1.58 0.40 [0.32, 0.49]
## halfs 1.48 [ 1.27, 1.83] 1.22 0.68 [0.55, 0.79]
##
## High Correlation
##
## Term VIF VIF 95% CI Increased SE Tolerance
## container 10.77 [ 8.34, 14.00] 3.28 0.09
## time 120.29 [91.79, 157.74] 10.97 8.31e-03
## I(time^2) 26.34 [20.20, 34.43] 5.13 0.04
## container:time 77.46 [59.16, 101.53] 8.80 0.01
## container:I(time^2) 40.40 [30.92, 52.89] 6.36 0.02
## Tolerance 95% CI
## [0.07, 0.12]
## [0.01, 0.01]
## [0.03, 0.05]
## [0.01, 0.02]
## [0.02, 0.03]
## Model has interaction terms. VIFs might be inflated.
## You may check multicollinearity among predictors of a model without
## interaction terms.
## # Check for Multicollinearity
##
## Low Correlation
##
## Term VIF VIF 95% CI Increased SE Tolerance Tolerance 95% CI
## tueE 1.87 [ 1.56, 2.33] 1.37 0.54 [0.43, 0.64]
## wedE 1.83 [ 1.54, 2.28] 1.35 0.55 [0.44, 0.65]
## thuE 1.66 [ 1.41, 2.07] 1.29 0.60 [0.48, 0.71]
## friE 1.65 [ 1.41, 2.06] 1.29 0.60 [0.49, 0.71]
## satE 1.80 [ 1.51, 2.24] 1.34 0.56 [0.45, 0.66]
## temp_c 2.34 [ 1.93, 2.95] 1.53 0.43 [0.34, 0.52]
## humi_p 2.01 [ 1.67, 2.52] 1.42 0.50 [0.40, 0.60]
## prcp_mm 1.25 [ 1.11, 1.57] 1.12 0.80 [0.64, 0.90]
## liquors 1.54 [ 1.32, 1.91] 1.24 0.65 [0.52, 0.76]
## sales 2.49 [ 2.04, 3.14] 1.58 0.40 [0.32, 0.49]
## halfs 1.48 [ 1.27, 1.83] 1.22 0.68 [0.55, 0.79]
##
## High Correlation
##
## Term VIF VIF 95% CI Increased SE Tolerance
## container 10.77 [ 8.34, 14.00] 3.28 0.09
## time 120.29 [91.79, 157.74] 10.97 8.31e-03
## I(time^2) 26.34 [20.20, 34.43] 5.13 0.04
## container:time 77.46 [59.16, 101.53] 8.80 0.01
## container:I(time^2) 40.40 [30.92, 52.89] 6.36 0.02
## Tolerance 95% CI
## [0.07, 0.12]
## [0.01, 0.01]
## [0.03, 0.05]
## [0.01, 0.02]
## [0.02, 0.03]
## Model has interaction terms. VIFs might be inflated.
## You may check multicollinearity among predictors of a model without
## interaction terms.
## # Check for Multicollinearity
##
## Low Correlation
##
## Term VIF VIF 95% CI Increased SE Tolerance Tolerance 95% CI
## tueE 1.87 [ 1.56, 2.33] 1.37 0.54 [0.43, 0.64]
## wedE 1.83 [ 1.54, 2.28] 1.35 0.55 [0.44, 0.65]
## thuE 1.66 [ 1.41, 2.07] 1.29 0.60 [0.48, 0.71]
## friE 1.65 [ 1.41, 2.06] 1.29 0.60 [0.49, 0.71]
## satE 1.80 [ 1.51, 2.24] 1.34 0.56 [0.45, 0.66]
## temp_c 2.34 [ 1.93, 2.95] 1.53 0.43 [0.34, 0.52]
## humi_p 2.01 [ 1.67, 2.52] 1.42 0.50 [0.40, 0.60]
## prcp_mm 1.25 [ 1.11, 1.57] 1.12 0.80 [0.64, 0.90]
## liquors 1.54 [ 1.32, 1.91] 1.24 0.65 [0.52, 0.76]
## sales 2.49 [ 2.04, 3.14] 1.58 0.40 [0.32, 0.49]
## halfs 1.48 [ 1.27, 1.83] 1.22 0.68 [0.55, 0.79]
##
## High Correlation
##
## Term VIF VIF 95% CI Increased SE Tolerance
## container 10.77 [ 8.34, 14.00] 3.28 0.09
## time 120.29 [91.79, 157.74] 10.97 8.31e-03
## I(time^2) 26.34 [20.20, 34.43] 5.13 0.04
## container:time 77.46 [59.16, 101.53] 8.80 0.01
## container:I(time^2) 40.40 [30.92, 52.89] 6.36 0.02
## Tolerance 95% CI
## [0.07, 0.12]
## [0.01, 0.01]
## [0.03, 0.05]
## [0.01, 0.02]
## [0.02, 0.03]
## OK: Residuals appear to be independent and not autocorrelated (p = 0.616).
## OK: Residuals appear to be independent and not autocorrelated (p = 0.680).
## OK: Residuals appear to be independent and not autocorrelated (p = 0.540).
## Warning in adf.test(df$log_food_waste_kg): p-value smaller than printed p-value
##
## Augmented Dickey-Fuller Test
##
## data: df$log_food_waste_kg
## Dickey-Fuller = -5.7678, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary
## Warning in adf.test(df$log_solid_waste_kg): p-value smaller than printed
## p-value
##
## Augmented Dickey-Fuller Test
##
## data: df$log_solid_waste_kg
## Dickey-Fuller = -6.8741, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary
## Warning in adf.test(df$log_liquid_waste_kg): p-value smaller than printed
## p-value
##
## Augmented Dickey-Fuller Test
##
## data: df$log_liquid_waste_kg
## Dickey-Fuller = -5.0025, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary
Log-linear Cubic multiple model
##
## Call:
## lm(formula = log_fw_rdt_mult_cubic, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.70638 -0.21978 -0.00819 0.20085 0.88926
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.467e-01 3.277e-01 -0.753 0.45276
## D_01 1.535e-02 1.525e-01 0.101 0.91998
## t_01 -4.504e-03 4.975e-03 -0.905 0.36682
## temp_c 1.412e-03 4.104e-03 0.344 0.73126
## humi_p 2.553e-03 3.038e-03 0.840 0.40202
## prcp_mm -2.443e-02 1.326e-02 -1.843 0.06744 .
## liquors 9.864e-03 1.713e-02 0.576 0.56572
## sales 1.232e-03 1.866e-04 6.599 7.37e-10 ***
## halfs 3.099e-02 9.482e-03 3.268 0.00136 **
## tueE 8.730e-02 6.082e-02 1.435 0.15337
## wedE -5.102e-02 6.036e-02 -0.845 0.39932
## thuE -8.900e-02 5.851e-02 -1.521 0.13045
## friE 2.497e-02 5.726e-02 0.436 0.66345
## satE -8.816e-02 6.030e-02 -1.462 0.14590
## I(t_01^2) -8.219e-05 5.992e-05 -1.372 0.17231
## I(t_01^3) -3.608e-07 4.630e-07 -0.779 0.43714
## D_01:t_01 1.323e-02 9.671e-03 1.368 0.17341
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.321 on 144 degrees of freedom
## Multiple R-squared: 0.5633, Adjusted R-squared: 0.5148
## F-statistic: 11.61 on 16 and 144 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = log_sfw_rdt_mult_cubic, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.36678 -0.14222 -0.03583 0.12732 0.84012
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.137e-01 2.136e-01 -1.001 0.3187
## D_01 4.104e-02 9.941e-02 0.413 0.6804
## t_01 -6.172e-03 3.243e-03 -1.903 0.0591 .
## temp_c -5.309e-04 2.676e-03 -0.198 0.8430
## humi_p 7.627e-04 1.980e-03 0.385 0.7007
## prcp_mm -1.441e-02 8.644e-03 -1.667 0.0977 .
## liquors 7.730e-03 1.117e-02 0.692 0.4900
## sales 7.348e-04 1.217e-04 6.040 1.25e-08 ***
## halfs 8.612e-03 6.182e-03 1.393 0.1657
## tueE 8.676e-02 3.965e-02 2.188 0.0303 *
## wedE -8.591e-03 3.935e-02 -0.218 0.8275
## thuE -6.834e-02 3.814e-02 -1.792 0.0753 .
## friE 1.950e-02 3.733e-02 0.522 0.6023
## satE -5.739e-02 3.931e-02 -1.460 0.1464
## I(t_01^2) -7.031e-05 3.906e-05 -1.800 0.0740 .
## I(t_01^3) 1.553e-08 3.018e-07 0.051 0.9590
## D_01:t_01 1.085e-02 6.305e-03 1.721 0.0874 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2093 on 144 degrees of freedom
## Multiple R-squared: 0.4522, Adjusted R-squared: 0.3914
## F-statistic: 7.43 on 16 and 144 DF, p-value: 1.909e-12
##
## Call:
## lm(formula = log_lfw_rdt_mult_cubic, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.65347 -0.20142 -0.00552 0.20877 0.72859
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.789e-01 2.943e-01 -0.948 0.344767
## D_01 -2.936e-03 1.369e-01 -0.021 0.982922
## t_01 -7.497e-04 4.467e-03 -0.168 0.866959
## temp_c 1.665e-03 3.685e-03 0.452 0.652120
## humi_p 2.430e-03 2.728e-03 0.891 0.374577
## prcp_mm -1.875e-02 1.191e-02 -1.575 0.117517
## liquors 5.553e-03 1.538e-02 0.361 0.718659
## sales 1.018e-03 1.676e-04 6.076 1.05e-08 ***
## halfs 3.131e-02 8.514e-03 3.677 0.000333 ***
## tueE 2.976e-02 5.461e-02 0.545 0.586718
## wedE -5.411e-02 5.419e-02 -0.998 0.319756
## thuE -7.313e-02 5.254e-02 -1.392 0.166094
## friE 3.257e-02 5.142e-02 0.633 0.527484
## satE -6.215e-02 5.414e-02 -1.148 0.252934
## I(t_01^2) -4.927e-05 5.380e-05 -0.916 0.361372
## I(t_01^3) -5.401e-07 4.157e-07 -1.299 0.195981
## D_01:t_01 8.200e-03 8.684e-03 0.944 0.346592
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2882 on 144 degrees of freedom
## Multiple R-squared: 0.5629, Adjusted R-squared: 0.5144
## F-statistic: 11.59 on 16 and 144 DF, p-value: < 2.2e-16
Ass-Poly
- Independence of the observations
- Normality of the residuals
- No influential points (outliers)
- Homoscedasticity of the residuals
- Linearity of the relationships between the dependent and independent variables
- No multicollinearity
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
## Warning in adf.test(df$log_food_waste_kg): p-value smaller than printed p-value
##
## Augmented Dickey-Fuller Test
##
## data: df$log_food_waste_kg
## Dickey-Fuller = -5.7678, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary
## Warning in adf.test(df$log_solid_waste_kg): p-value smaller than printed
## p-value
##
## Augmented Dickey-Fuller Test
##
## data: df$log_solid_waste_kg
## Dickey-Fuller = -6.8741, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary
## Warning in adf.test(df$log_liquid_waste_kg): p-value smaller than printed
## p-value
##
## Augmented Dickey-Fuller Test
##
## data: df$log_liquid_waste_kg
## Dickey-Fuller = -5.0025, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary
## OK: Residuals appear to be independent and not autocorrelated (p = 0.660).
## OK: Residuals appear to be independent and not autocorrelated (p = 0.678).
## OK: Residuals appear to be independent and not autocorrelated (p = 0.592).
## lag Autocorrelation D-W Statistic p-value
## 1 -0.01991081 2.001594 0.694
## Alternative hypothesis: rho != 0
## lag Autocorrelation D-W Statistic p-value
## 1 -0.04642712 2.014825 0.714
## Alternative hypothesis: rho != 0
## lag Autocorrelation D-W Statistic p-value
## 1 -0.002456668 1.981727 0.556
## Alternative hypothesis: rho != 0
##
## Durbin-Watson test
##
## data: log_rdt_mult_cubic_of$`log food waste`
## DW = 2.0016, p-value = 0.3299
## alternative hypothesis: true autocorrelation is greater than 0
##
## Durbin-Watson test
##
## data: log_rdt_mult_cubic_of$`log solid waste`
## DW = 2.0148, p-value = 0.3605
## alternative hypothesis: true autocorrelation is greater than 0
##
## Durbin-Watson test
##
## data: log_rdt_mult_cubic_of$`log liquid waste`
## DW = 1.9817, p-value = 0.286
## alternative hypothesis: true autocorrelation is greater than 0
## OK: residuals appear as normally distributed (p = 0.870).
## Warning: Non-normality of residuals detected (p < .001).
## OK: residuals appear as normally distributed (p = 0.612).
## OK: No outliers detected.
## - Based on the following method and threshold: cook (1).
## - For variable: (Whole model)
## OK: No outliers detected.
## - Based on the following method and threshold: cook (1).
## - For variable: (Whole model)
## OK: No outliers detected.
## - Based on the following method and threshold: cook (1).
## - For variable: (Whole model)
##
## studentized Breusch-Pagan test
##
## data: log_rdt_mult_cubic_of$`log food waste`
## BP = 23.182, df = 16, p-value = 0.1089
##
## studentized Breusch-Pagan test
##
## data: log_rdt_mult_cubic_of$`log solid waste`
## BP = 14.093, df = 16, p-value = 0.5918
##
## studentized Breusch-Pagan test
##
## data: log_rdt_mult_cubic_of$`log liquid waste`
## BP = 15.567, df = 16, p-value = 0.4836
## Warning: Heteroscedasticity (non-constant error variance) detected (p = 0.009).
## OK: Error variance appears to be homoscedastic (p = 0.458).
## OK: Error variance appears to be homoscedastic (p = 0.089).
## Model has interaction terms. VIFs might be inflated.
## You may check multicollinearity among predictors of a model without
## interaction terms.
## there are higher-order terms (interactions) in this model
## consider setting type = 'predictor'; see ?vif
Local log-linear Regression
Interaction - b/w week and month
## Loading required package: sandwich
## Warning: package 'sandwich' was built under R version 4.2.3
## Loading required package: AER
## Loading required package: survival
## Loading required package: Formula
## [1] 6.03181
## [1] 4.095261
## [1] 5.845282
Covariates continuity test
Placebo test
Donut hole test
Food waste
Solid Food waste
Liquid food waste
log-linear Multiple - month
##
## Call:
## lm(formula = log_food_waste_kg ~ container * time + temp_c +
## humi_p + prcp_mm + tueE + wedE + thuE + friE + satE + liquors +
## sales + halfs, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.51357 -0.16849 0.01946 0.12329 0.61325
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.2988962 0.6895540 0.433 0.66726
## container 0.0751821 0.1844288 0.408 0.68595
## time -0.0035192 0.0090010 -0.391 0.69812
## temp_c 0.0069893 0.0076565 0.913 0.36739
## humi_p -0.0036874 0.0071753 -0.514 0.61047
## prcp_mm -0.0482459 0.0274499 -1.758 0.08732 .
## tueE 0.1637430 0.1050361 1.559 0.12776
## wedE 0.0131842 0.1098702 0.120 0.90515
## thuE -0.0631627 0.0994321 -0.635 0.52929
## friE 0.0006048 0.0987478 0.006 0.99515
## satE -0.1848926 0.1050318 -1.760 0.08684 .
## liquors 0.0040398 0.0296279 0.136 0.89230
## sales 0.0012807 0.0003682 3.478 0.00134 **
## halfs 0.0303484 0.0196676 1.543 0.13156
## container:time 0.0092436 0.0137591 0.672 0.50599
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3018 on 36 degrees of freedom
## Multiple R-squared: 0.6852, Adjusted R-squared: 0.5627
## F-statistic: 5.596 on 14 and 36 DF, p-value: 1.496e-05
##
## Call:
## lm(formula = log_solid_waste_kg ~ container * time + temp_c +
## humi_p + prcp_mm + tueE + wedE + thuE + friE + satE + liquors +
## sales + halfs, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.23587 -0.09713 -0.00118 0.07621 0.37761
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.2503976 0.3792951 0.660 0.513350
## container 0.0017171 0.1014466 0.017 0.986589
## time -0.0009035 0.0049511 -0.182 0.856225
## temp_c 0.0076969 0.0042115 1.828 0.075913 .
## humi_p -0.0035071 0.0039469 -0.889 0.380123
## prcp_mm -0.0125956 0.0150991 -0.834 0.409673
## tueE 0.0361610 0.0577760 0.626 0.535340
## wedE 0.0311853 0.0604350 0.516 0.609000
## thuE -0.0499517 0.0546935 -0.913 0.367160
## friE 0.0180888 0.0543171 0.333 0.741050
## satE -0.0788150 0.0577736 -1.364 0.180972
## liquors 0.0058179 0.0162971 0.357 0.723185
## sales 0.0007934 0.0002025 3.918 0.000383 ***
## halfs 0.0044730 0.0108184 0.413 0.681720
## container:time 0.0012049 0.0075683 0.159 0.874395
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.166 on 36 degrees of freedom
## Multiple R-squared: 0.6558, Adjusted R-squared: 0.5219
## F-statistic: 4.899 on 14 and 36 DF, p-value: 5.863e-05
##
## Call:
## lm(formula = log_liquid_waste_kg ~ container * time + temp_c +
## humi_p + prcp_mm + tueE + wedE + thuE + friE + satE + liquors +
## sales + halfs, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.52081 -0.14938 0.01322 0.14151 0.59771
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.0146367 0.6279620 -0.023 0.98153
## container 0.0843277 0.1679554 0.502 0.61867
## time -0.0031940 0.0081970 -0.390 0.69909
## temp_c 0.0024800 0.0069726 0.356 0.72416
## humi_p -0.0006411 0.0065344 -0.098 0.92239
## prcp_mm -0.0486593 0.0249981 -1.947 0.05943 .
## tueE 0.1400310 0.0956541 1.464 0.15189
## wedE -0.0282689 0.1000564 -0.283 0.77916
## thuE -0.0598792 0.0905507 -0.661 0.51264
## friE 0.0087874 0.0899275 0.098 0.92270
## satE -0.1478034 0.0956502 -1.545 0.13103
## liquors 0.0050597 0.0269815 0.188 0.85230
## sales 0.0009589 0.0003353 2.860 0.00701 **
## halfs 0.0333015 0.0179109 1.859 0.07118 .
## container:time 0.0099003 0.0125301 0.790 0.43463
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.2749 on 36 degrees of freedom
## Multiple R-squared: 0.6655, Adjusted R-squared: 0.5354
## F-statistic: 5.116 on 14 and 36 DF, p-value: 3.793e-05